import http from "@/utils/http";

//请求权限树结构数据
export const getListByCreate = (isAll: number = 1) =>
  http({
    url: `/api/accessgroup/getlistbycreate/getlistbycreate/${isAll}`,
    method: "get",
  });

//获取角色管理详情
export const getAccessRight = (data: any) =>
  http({
    url: `/api/accessgroup/get/${data.parentId}/${data.accessGroupId || 0}`,
    method: "get",
    data,
  });

//获取权限组对应的人员
export const getAdminListGroup = (data: any) =>
  http({
    url: `/api/funclist/getaccessgroupadmin/${data.accessGroupId}`,
    method: "get",
    data,
  });

//删除权限组
export const deleteAccessRight = (data: any) =>
  http({
    url: `/api/accessgroup/delete/${data.accessGroupId}`,
    method: "delete",
  });

//编辑权限组
export const accessGroupPage = (data: any) =>
  http({
    url: "/api/accessgroup/save",
    method: "post",
    data,
  });

//查询父级节点数据
export const getparentId = (data: any) =>
  http({
    url: `/api/accessgroup/getlistbycreate/getlistbycreate/${data.isAll}`,
    method: "get",
    data,
  });

export const getReturnUser = (data: any) =>
  http({
    url: `/api/accessgroup/getbyuserid/forselect/${data.UserId}`,
    method: "get",
    data,
  });
